package cn.xuziao.databasecourse.dao;

import cn.xuziao.databasecourse.pojo.ComplexInfo;
import cn.xuziao.databasecourse.pojo.SimpleInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xuziao
 * @date 2021/11/7 11:24
 */
@Repository
@Mapper
public interface SimpleInfoMap {
    @Insert("insert into image_vedio_music(info_path, info_type) values (#{info_path}, #{info_type})")
    int insertSimpleInfo(SimpleInfo simpleInfo);

    @Select("select * from image_vedio_music where info_path like #{input} or description like #{input}")
    List<SimpleInfo> selectSimpleInfo(String input);

    @Select("select * from image_vedio_music where id = #{id}")
    SimpleInfo selectSimpleInfoById(int id);

    @Select("Select * from image_vedio_music where ${infoType} like ${value}")
    List<SimpleInfo> selectSimpleInfoByType(String infoType, String value);

}
